package com.hellogwt.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.*;
import com.hellogwt.client.presenter.EditGreetingPresenter;

public class EditGreetingView extends Composite implements EditGreetingPresenter.Display {

    interface EditGreetingViewUiBinder extends UiBinder<Widget, EditGreetingView> {
    }

    private static EditGreetingViewUiBinder uiBinder = GWT.create(EditGreetingViewUiBinder.class);

    @UiField
    TextBox authorTextBox;
    @UiField
    TextBox textTextBox;
    @UiField
    Button addButton;
    @UiField
    Button updateButton;
    @UiField
    Button deleteButton;
    @UiField
    Button cancelButton;

    public EditGreetingView() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    @Override
    public HasValue<String> getAuthorTextBox() {
        return authorTextBox;
    }

    @Override
    public HasValue<String> getTextTextBox() {
        return textTextBox;
    }

    @Override
    public HasClickHandlers getAddButton() {
        return addButton;
    }

    @Override
    public HasClickHandlers getUpdateButton() {
        return updateButton;
    }

    @Override
    public HasClickHandlers getDeleteButton() {
        return deleteButton;
    }

    @Override
    public HasClickHandlers getCancelButton() {
        return cancelButton;
    }

    @Override
    public Widget asWidget() {
        return this;
    }
}